/**
 * Description:
 * Class Name:DeprecatedTest
 * Date:2022/4/17 13:53
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第14章_Annotation注解._14_1_基本注解._14_1_2_Java9增强的Deprecated;

class Apple{
    // 定义info方法为已过时
    @Deprecated(since = "9", forRemoval = true)
    public void info(){
        System.out.println("a function in Fruit...");
    }
}

public class DeprecatedTest extends Apple{
    @Override
    public void info(){
        System.out.println("Apple overrode Fruit's info function...");
    }

    public static void main(String[] args) {
        // 运行使用info()方法会被编译器警告，虽然依旧可以运行不过在未来会有失效的风险
        new DeprecatedTest().info();
    }
}
